home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / win_utl1 / hb109.zip / HELP.BAS < prev    next >
BASIC Source File  |  1996-02-20  |  3KB  |  79 lines

  1.  
  2. ' MODULE:  HELP.BAS
  3. '
  4. ' PURPOSE: Help system definitions for Visual Basic V3
  5. '
  6. ' AUTHOR:  Graham Plowman
  7. '
  8. ' DATE:    20/2/96
  9.  
  10. Option Explicit
  11.  
  12. ' Commands to pass WinHelp()
  13. Global Const HELP_CONTEXT = &H1         ' Display topic in ulTopic
  14. Global Const HELP_QUIT = &H2            ' Terminate help
  15. Global Const HELP_INDEX = &H3           ' Display index
  16. Global Const HELP_CONTENTS = &H3
  17. Global Const HELP_HELPONHELP = &H4      ' Display help on using help
  18. Global Const HELP_SETINDEX = &H5        ' Set the current Index for multi index help
  19. Global Const HELP_SETCONTENTS = &H5
  20. Global Const HELP_CONTEXTPOPUP = &H8
  21. Global Const HELP_FORCEFILE = &H9
  22. Global Const HELP_KEY = &H101           ' Display topic for keyword in dwData
  23. Global Const HELP_COMMAND = &H102
  24. Global Const HELP_POPUPID = &H104
  25. Global Const HELP_PARTIALKEY = &H105    ' Partial key search (display search dialog)
  26. Global Const HELP_CLOSEWINDOW = &H107
  27. Global Const HELP_CONTEXTNOFOCUS = &H108
  28. Global Const HELP_MULTIKEY = &H201
  29. Global Const HELP_SETWINPOS = &H203
  30.  
  31. ' Function declarations
  32. Declare Function WinHelp16V Lib "User" Alias "WinHelp" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Any) As Integer
  33. Declare Function WinHelp16L Lib "User" Alias "WinHelp" (ByVal hWnd As Integer, ByVal lpHelpFile As String, ByVal wCommand As Integer, dwData As Long) As Integer
  34. Declare Function WinHelp32V Lib "User32" Alias "WinHelpA" (ByVal hWnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, dwData As Any) As Long
  35. Declare Function WinHelp32L Lib "User32" Alias "WinHelpA" (ByVal hWnd As Long, ByVal lpHelpFile As String, ByVal wCommand As Long, dwData As Long) As Long
  36.  
  37. Function HelpIndex (rfrmMain As Form) As Long
  38.  
  39.     HelpIndex = WinHelp(rfrmMain.hWnd, App.HelpFile, HELP_INDEX, 0)
  40.  
  41. End Function
  42.  
  43. Function HelpSearch (rfrmMain As Form) As Long
  44.  
  45.     Dim lsDummy As String
  46.  
  47.  
  48.     lsDummy = ""
  49.     HelpSearch = WinHelp(rfrmMain.hWnd, App.HelpFile, HELP_PARTIALKEY, lsDummy)
  50.  
  51. End Function
  52.  
  53. Function HelpUsing (rfrmMain As Form) As Long
  54.  
  55.     HelpUsing = WinHelp(rfrmMain.hWnd, "", HELP_HELPONHELP, 0)
  56.  
  57. End Function
  58.  
  59. Function WinHelp (ByVal vhWnd As Long, ByVal vlpHelpFile As String, ByVal vwCommand As Long, rdwdata As Variant) As Long
  60.  
  61.     Dim llLong As Long
  62.  
  63.  
  64.     ' Windows 3.1 - change for 32 bit calls
  65.     If VarType(rdwdata) = 3 Then  ' V_LONG
  66.         ' Handle call where rdwData is a numeric ie a context ID
  67.  
  68.         llLong = rdwdata
  69.         WinHelp = WinHelp16L(vhWnd, vlpHelpFile, vwCommand, llLong)
  70.  
  71.     Else
  72.         ' Handle call where rdwData is a string ie a search string
  73.  
  74.         WinHelp = WinHelp16V(vhWnd, vlpHelpFile, vwCommand, rdwdata)
  75.     End If
  76.  
  77. End Function
  78.  
  79.